package com.xbongbong.pro.message.help;/*/*/


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.message.domain.entity.PushSetEntity;
import com.xbongbong.paas.constant.PaasConstant;
import com.xbongbong.paas.domain.entity.PaasFormExplainEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt;
import com.xbongbong.paas.enums.FieldTypeEnum;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.help.CommonHelp;
import com.xbongbong.paas.model.PaasFormExplainModel;
import com.xbongbong.paas.model.PaasFormModel;
import com.xbongbong.paas.pojo.vo.ExplainCompareListVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.BeanUtil;
import com.xbongbong.paas.util.ExplainUtil;
import com.xbongbong.pro.enums.SaasMarkEnum;
import com.xbongbong.pro.message.constant.MessageSetDetailTitleConstants;
import com.xbongbong.pro.message.enums.MessageMenuTypeEnum;
import com.xbongbong.pro.message.enums.PushObjectTypeEnum;
import com.xbongbong.pro.message.enums.PushTypeEnum;
import com.xbongbong.pro.message.enums.WorkOrderV2PushTypeEnum;
import com.xbongbong.pro.message.model.PushSetModel;
import com.xbongbong.pro.message.pojo.MessageMenuPojo;
import com.xbongbong.pro.message.pojo.MessageSetDetailPojo;
import com.xbongbong.pro.message.pojo.dto.MessageSetDetailDTO;
import com.xbongbong.pro.message.pojo.vo.PushSetVO;
import com.xbongbong.pro.message.pushset.CluePushSet;
import com.xbongbong.pro.message.pushset.CommunicatePlanPushSet;
import com.xbongbong.pro.message.pushset.CommunicatePushSet;
import com.xbongbong.pro.message.pushset.ContractPushSet;
import com.xbongbong.pro.message.pushset.ContractRemindPushSet;
import com.xbongbong.pro.message.pushset.CustomerAttrPushSet;
import com.xbongbong.pro.message.pushset.CustomerContactPushSet;
import com.xbongbong.pro.message.pushset.CustomerPushSet;
import com.xbongbong.pro.message.pushset.DistributorCommunicatePushSet;
import com.xbongbong.pro.message.pushset.DistributorContactPushSet;
import com.xbongbong.pro.message.pushset.DistributorPushSet;
import com.xbongbong.pro.message.pushset.InvoicePushSet;
import com.xbongbong.pro.message.pushset.InvoiceRedPushSet;
import com.xbongbong.pro.message.pushset.OpportunityPushSet;
import com.xbongbong.pro.message.pushset.OrderPushSet;
import com.xbongbong.pro.message.pushset.PayPlanPushSet;
import com.xbongbong.pro.message.pushset.PayPlanRemindOverduePushSet;
import com.xbongbong.pro.message.pushset.PayPlanRemindPushSet;
import com.xbongbong.pro.message.pushset.PaySheetBadPushSet;
import com.xbongbong.pro.message.pushset.PaySheetPrepaySet;
import com.xbongbong.pro.message.pushset.PaySheetPushSet;
import com.xbongbong.pro.message.pushset.PaySheetRedPrepaySet;
import com.xbongbong.pro.message.pushset.PaySheetRedPushSet;
import com.xbongbong.pro.message.pushset.PaymentPlanPushSet;
import com.xbongbong.pro.message.pushset.PaymentRemindOverduePushSet;
import com.xbongbong.pro.message.pushset.PaymentRemindPushSet;
import com.xbongbong.pro.message.pushset.PaymentSheetBadPushSet;
import com.xbongbong.pro.message.pushset.PaymentSheetPrepaymentSet;
import com.xbongbong.pro.message.pushset.PaymentSheetPushSet;
import com.xbongbong.pro.message.pushset.PaymentSheetRedPrepaymentSet;
import com.xbongbong.pro.message.pushset.PaymentSheetRedPushSet;
import com.xbongbong.pro.message.pushset.PaymentTaskPushSet;
import com.xbongbong.pro.message.pushset.PurchaseInvoicePushSet;
import com.xbongbong.pro.message.pushset.PurchaseInvoiceRedPushSet;
import com.xbongbong.pro.message.pushset.QuotationPushSet;
import com.xbongbong.pro.message.pushset.QuotationRemindPushSet;
import com.xbongbong.pro.message.pushset.RefundPushSet;
import com.xbongbong.pro.message.pushset.SalePushSet;
import com.xbongbong.pro.message.pushset.SignInPushSet;
import com.xbongbong.pro.message.pushset.WorkOrderPushSet;
import com.xbongbong.pro.message.pushset.WorkReportOverduePushSet;
import com.xbongbong.pro.message.pushset.WorkReportPushSet;
import com.xbongbong.pro.message.pushset.WorkReportRemindPushSet;
import com.xbongbong.saas.constant.BasicConstant;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import com.xbongbong.saas.help.ExplainHelp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * Description: 消息设置help类
 * @author 魏荣杰
 * @date 2019/1/6 0:59
 * @version v1.0
 * @since v1.0
 */
@Deprecated
public class MessageSetHelper {

    private static final Logger LOG = LoggerFactory.getLogger(MessageSetHelper.class);

    @Resource
    private PushSetModel pushSetModel;
    @Resource
    private PaasFormModel paasFormModel;
    @Resource
    private PaasFormExplainModel paasFormExplainModel;
    @Resource
    private CommonHelp commonHelp;

    /**
     * Description:获取推送设置页左侧菜单的子菜单
     * @param code 所属模块，1：crm 2：jxc 3：工单 4:资金管理
     * @return 子菜单
     */
    @Deprecated
    public List<MessageMenuPojo> getMessageSetSaasMenu(Integer code) {
        List<MessageMenuPojo> menuList = new ArrayList<>();
        List<MessageMenuTypeEnum> pushEnum = MessageMenuTypeEnum.getAllEnumByType(code);
        for (MessageMenuTypeEnum messageMenuTypeEnum : pushEnum) {
            MessageMenuPojo messageMenuPojo = new MessageMenuPojo(messageMenuTypeEnum.getSubCode(), messageMenuTypeEnum.getName());
            menuList.add(messageMenuPojo);
        }
        return menuList;
    }

    /**
     * Description: 获取所有saas的消息设置list
     * 特别注意: PushTypeEnum.getAlias与方法名getMessageSetSaas XXX DetailList要保持对应 eg: orderPush->getMessageSetSaasOrderPushDetailList
     * @param messageSetDetailDTO messageSetDetailDTO
     * @return java.util.List<com.xbongbong.pro.message.pojo.MessageSetDetailPojo>
     */
    @Deprecated
    public List<MessageSetDetailPojo> getMessageSetSaasDetailList(MessageSetDetailDTO messageSetDetailDTO) throws IllegalAccessException, XbbException, InstantiationException, Exception {
        String corpid = messageSetDetailDTO.getCorpid();
        List<Long> saasIds = messageSetDetailDTO.getSaasIds();

        List<MessageSetDetailPojo> messageSetDetailPojos = new ArrayList<>();
        for (Long type : saasIds) {
            Integer typeInt = type.intValue();
            // 经销商转类型，借用XbbRefTypeEnum中的方法
            typeInt = XbbRefTypeEnum.transferBusinessType4Distributor(typeInt, messageSetDetailDTO.getDistributorMark());
            String alias = PushTypeEnum.getByCode(typeInt).getAlias();
            String methodName = "getMessageSetSaas" + alias.substring(0, 1).toUpperCase() + alias.substring(1) + "DetailList";
            try {
                Method method = this.getClass().getDeclaredMethod(methodName, String.class, List.class, Integer.class);
                method.invoke(this, corpid, messageSetDetailPojos, typeInt);
            } catch (NoSuchMethodException e) {
                LOG.error("com.xbongbong.pro.message.help.MessageSetHelper.getMessageSetSaasDetailList", e);
            }
        }

        return messageSetDetailPojos;
    }

    @Deprecated
    public void getMessageSetSaasWorkOrderV2PushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        //与之前消息推送手动拼装不同,之后使用corpid=0的默认配置项初始化,初始化目前走代码,开发完成后改造为Script脚本
        //默认工单推送详情初始化
        Map<String,Object> defaultParam = new HashMap<>(2);
        defaultParam.put("corpid", "0");
        defaultParam.put("type", XbbRefTypeEnum.WORK_ORDER_V2.getCode());
        List<PushSetEntity> entitys = pushSetModel.findEntitys(defaultParam);
        if (entitys.size() == 0){
            initWorkOrderV2DetailList();
        }
        //获取默认数据
        List<PushSetEntity> defaultEntites = pushSetModel.findEntitys(defaultParam);
        //获取当前公司数据
        Map<String,Object> currentParam = new HashMap<>(2);
        currentParam.put("corpid", corpid);
        currentParam.put("type", XbbRefTypeEnum.WORK_ORDER_V2.getCode());
        List<PushSetEntity> currentEntities = pushSetModel.findEntitys(currentParam);
        //若公司已有部分数据,则覆盖这一部分数据,其余保持默认
        Map<Integer, PushSetEntity> currentMap = new HashMap<>(15);
        currentEntities.forEach(entity -> currentMap.put(entity.getSubType(), entity));
        List<PushSetVO> pushSetVOList = defaultEntites.stream().map(entity -> {
            PushSetVO vo = new PushSetVO();
            PushSetEntity currentEntity = currentMap.get(entity.getSubType());
            if (Objects.isNull(currentEntity)){
                BeanUtil.copyProperties(entity, vo);
                vo.setId(BasicConstant.ZERO);
            } else {
                BeanUtil.copyProperties(currentEntity, vo);
            }
            WorkOrderV2PushTypeEnum pushTypeEnum = WorkOrderV2PushTypeEnum.getBySubCode(vo.getSubType());
            vo.setTitle(pushTypeEnum.getTitle());
            vo.setContent(pushTypeEnum.getContent());
            vo.setModule(pushTypeEnum.getModule());
            return vo;
        }).collect(Collectors.toList());
        //拼装数据
        MessageSetDetailPojo detailPojo1 = new MessageSetDetailPojo();
        detailPojo1.setTitle("工单中心常规推送");
        detailPojo1.setValue(pushSetVOList.stream().filter(vo -> vo.getModule()==1).collect(Collectors.toList()));
        messageSetDetailPojos.add(detailPojo1);
        MessageSetDetailPojo detailPojo2 = new MessageSetDetailPojo();
        detailPojo2.setTitle("工单状态变更");
        detailPojo2.setValue(pushSetVOList.stream().filter(vo -> vo.getModule()==2).collect(Collectors.toList()));
        messageSetDetailPojos.add(detailPojo2);
    }

    private void getMessageSetSaasStatementDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) {
        List<PushTypeEnum> basePushTypeEnum = Arrays.asList(PushTypeEnum.STATEMENT_GENERATE_PUSH, PushTypeEnum.STATEMENT_REMIND_CONFIRM_PUSH, PushTypeEnum.STATEMENT_VALET_CONFIRM_PUSH, PushTypeEnum.STATEMENT_REGENERATE_PUSH, PushTypeEnum.STATEMENT_GENERATE_PUSH);

    }

    private void getMessageSetSaasCreditLimitDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) {

    }

    @Deprecated
    private void getMessageSetSaasOrderPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.ORDER_ADD_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.ORDER_CHANGE_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.ORDER_TEAM_ADD_DEL_MAIN_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.ORDER_TEAM_ADD_DEL_SYNERGETIC_PUSH.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        OrderPushSet orderPushSet = new OrderPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.ORDER_BASE));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = orderPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * 封装回款计划相关消息
     *
     * @param corpid
     * @param messageSetDetailPojos
     * @param typeInt
     */
    private void getMessageSetSaasPaymentTaskPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.PAYMENT_TASK_ADD_PUSH.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        PaymentTaskPushSet paymentTaskPushSet = new PaymentTaskPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.PAYMENT_TASK_BASE));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = paymentTaskPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    @Deprecated
    private void getMessageSetSaasCustomerRemindDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws InstantiationException, IllegalAccessException, XbbException {
        Map<String, Object> param = new HashMap<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);
        param.put("corpid", corpid);
        param.put("del", 0);
        param.put("enable", 1);
        param.put("businessType", XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode());
        param.put("saasMark", SaasMarkEnum.SAAS.getCode());
        List<PaasFormEntityExt> paasFormEntityExtList = paasFormModel.list(param);
        List<Long> formIds = new ArrayList<>();
        for (PaasFormEntityExt entityExt : paasFormEntityExtList) {
            formIds.add(entityExt.getId());
        }
        param.clear();
        param.put("corpid", corpid);
        param.put("del", 0);
        param.put("formIdIn", formIds);
        List<PaasFormExplainEntity> paasFormExplainEntityExtList = paasFormExplainModel.findEntitys(param);
        Map<Long, Map<String, FieldAttrEntity>> formIdAndExplainMap = new HashMap<>();
        for (PaasFormExplainEntity explainEntityExt : paasFormExplainEntityExtList) {
            Map<String, FieldAttrEntity> explainMap = ExplainUtil.getExplainMap(explainEntityExt.getExplains());
            formIdAndExplainMap.put(explainEntityExt.getFormId(), explainMap);
        }
        CustomerAttrPushSet customerAttrPushSet = new CustomerAttrPushSet();
        for (PaasFormEntityExt entity : paasFormEntityExtList) {
            Long formId = entity.getId();
            List<PushSetEntity> pushSetEntityList = new ArrayList<>();
            Map<String, FieldAttrEntity> fieldAttrEntityMap = formIdAndExplainMap.get(formId);
            List<String> attrList = new ArrayList<>();
            if (Objects.nonNull(fieldAttrEntityMap)) {
                for (Map.Entry<String, FieldAttrEntity> entry : fieldAttrEntityMap.entrySet()) {
                    String key = entry.getKey();
                    FieldAttrEntity fieldAttrEntity = entry.getValue();
                    if (Objects.equals(fieldAttrEntity.getFieldType(), FieldTypeEnum.DATETIME.getType()) && Objects.equals(fieldAttrEntity.getIsRedundant(), 1)) {
                        attrList.add(key);
                    }
                }
            }

            pushSetEntityList = customerAttrPushSet.getPushSet(corpid, attrList, pushSetModel, formId);
            pushSetEntityList.forEach(v -> {
                FieldAttrEntity fieldAttrEntity = fieldAttrEntityMap.get(v.getAttrEntity());
                v.setTitle(fieldAttrEntity.getAttrName());
            });


            List<PushSetVO> pushSetVOList = new ArrayList<>();
            BeanUtil.copyPropertiesList(pushSetEntityList, pushSetVOList, PushSetVO.class);

            MessageSetDetailPojo messageSetDetailPojo = new MessageSetDetailPojo();
            messageSetDetailPojo.setTitle(entity.getName());
            messageSetDetailPojo.setValue(pushSetVOList);
            messageSetDetailPojos.add(messageSetDetailPojo);
        }
    }

    /**
     * Description: 获取saas 工单消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasWorkOrderPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        List<PushTypeEnum> workorderPushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_NEW_EXECUTOR.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_NEW_EXECUTED.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_CONFIRM.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_TEAM.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_STAGE_COMPLETE.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_DEL_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_COMPLETE.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_CLOSE.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_RESTART.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_TRANSFER.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORKORDER_ROLLBACK.getSubCode())) {
                workorderPushTypeEnum.add(pushTypeEnum);
            }
        }
        WorkOrderPushSet workOrderPushSet = new WorkOrderPushSet();
        MessageSetDetailPojo baseDetail = new MessageSetDetailPojo();
        baseDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.WORK_ORDER_BASE));
        List<PushSetEntity> basePushSetList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = workOrderPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushSetList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        baseDetail.setValue(pushSetVOList);
        messageSetDetailPojos.add(baseDetail);

        MessageSetDetailPojo otherDetail = new MessageSetDetailPojo();
        otherDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.WORK_ORDER_STATUS_CHANGE));
        List<PushSetEntity> workOrderPushSetList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : workorderPushTypeEnum) {
            PushSetEntity pushSetEntity = workOrderPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            workOrderPushSetList.add(pushSetEntity);
        }
        List<PushSetVO> otherPushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(workOrderPushSetList, otherPushSetVOList, PushSetVO.class);
        otherDetail.setValue(otherPushSetVOList);
        messageSetDetailPojos.add(otherDetail);
    }

    /**
     * Description: 获取saas 工作报告消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasWorkReportPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORK_REPORT_ADD_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORK_REPORT_REMIND_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORK_REPORT_OVERDUE_PUSH.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        WorkReportPushSet workReportPushSet = new WorkReportPushSet();
        WorkReportRemindPushSet workReportRemindPushSet = new WorkReportRemindPushSet();
        WorkReportOverduePushSet workReportOverduePushSet = new WorkReportOverduePushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.WORK_REPORT_BASE));
        List<PushSetEntity> basePushSetList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORK_REPORT_ADD_PUSH.getSubCode())) {
                PushSetEntity pushSetEntity = workReportPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
                basePushSetList.add(pushSetEntity);
            } else if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORK_REPORT_REMIND_PUSH.getSubCode())) {
                PushSetEntity pushSetEntity = workReportRemindPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
                basePushSetList.add(pushSetEntity);
            } else if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.WORK_REPORT_OVERDUE_PUSH.getSubCode())) {
                PushSetEntity pushSetEntity = workReportOverduePushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
                basePushSetList.add(pushSetEntity);
            }
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 签到消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasSignInAddPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));

        SignInPushSet signInPushSet = new SignInPushSet();
        List<PushSetEntity> basePushSetList = new ArrayList<>();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.SIGN_IN_BASE));
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            PushSetEntity pushSetEntity = signInPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushSetList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 退货退款消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    private void getMessageSetSaasRefundDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (pushTypeEnum.getSubCode() >0 && pushTypeEnum.getSubCode() <= 3) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        RefundPushSet refundPushSet = new RefundPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.REFUND_BASE));
        List<PushSetEntity> basePushSetList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = refundPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushSetList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 销售简报消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasSaleReportPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        SalePushSet salePushSet = new SalePushSet();
        List<PushSetEntity> basePushSetList = new ArrayList<>();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.SALE_REPORT_BASE));
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            PushSetEntity pushSetEntity = salePushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushSetList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 发票消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasInvoicePushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (pushTypeEnum.getSubCode() > 0) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        InvoicePushSet invoicePushSet = new InvoicePushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.INVOICE_BASE));
        List<PushSetEntity> basePushSetList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = invoicePushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushSetList.add(pushSetEntity);
        }

        InvoiceRedPushSet invoiceRedPushSet = new InvoiceRedPushSet();
        PushSetEntity invoiceRedPushSetEntity = invoiceRedPushSet.getPushSet(corpid, PushTypeEnum.INVOICE_RED_ADD_PUSH.getSubCode(), pushSetModel);
        basePushSetList.add(invoiceRedPushSetEntity);

        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 进项发票消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasPurchaseInvoicePushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (pushTypeEnum.getSubCode() > 0) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        PurchaseInvoicePushSet purchaseInvoicePushSet = new PurchaseInvoicePushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.PURCHASE_INVOICE_BASE));
        List<PushSetEntity> basePushSetList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = purchaseInvoicePushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushSetList.add(pushSetEntity);
        }

        PurchaseInvoiceRedPushSet purchaseInvoiceRedPushSet = new PurchaseInvoiceRedPushSet();
        PushSetEntity invoiceRedPushSetEntity = purchaseInvoiceRedPushSet.getPushSet(corpid, PushTypeEnum.PURCHASE_INVOICE_RED_ADD_PUSH.getSubCode(), pushSetModel);
        basePushSetList.add(invoiceRedPushSetEntity);

        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 回款提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     */
    @Deprecated
    private void getMessageSetSaasPaymentPlanAddDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
//        pushTypeEnumList.clear();
//        pushTypeEnumList.addAll(PushTypeEnum.getAllEnumByType(typeInt));
//
//        PaymentRemindPushSet paymentRemindPushSet = new PaymentRemindPushSet();
//        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
//        detailPojo.setTitle(MessageSetDetailTitleConstants.PAYMENT_REMIND);
//        List<PushSetEntity> basePushSetList = new ArrayList<>();
//        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
//            PushSetEntity pushSetEntity = paymentRemindPushSet.getPushSet(corpid,pushTypeEnum.getSubCode(), pushSetModel);
//            basePushSetList.add(pushSetEntity);
//        }
//        List<PushSetVO> pushSetVOList = new ArrayList<>();
//        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
//        detailPojo.setValue(pushSetVOList);
//        messageSetDetailPojos.add(detailPojo);
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.PAYMENT_REMIND));
        List<PushSetEntity> basePushSetList = new ArrayList<>();

        PaymentPlanPushSet paymentPlanPushSet = new PaymentPlanPushSet();
        PushSetEntity paymentPlanPushSetEntity = paymentPlanPushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_PLAN_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(paymentPlanPushSetEntity);

        PaymentRemindPushSet paymentRemindPushSet = new PaymentRemindPushSet();
        PushSetEntity paymentRemindPushSetEntity = paymentRemindPushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_REMIND.getSubCode(), pushSetModel);
        basePushSetList.add(paymentRemindPushSetEntity);

        PaymentRemindOverduePushSet paymentRemindOverduePushSet = new PaymentRemindOverduePushSet();
        PushSetEntity paymentRemindOverduePushSetEntity = paymentRemindOverduePushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_OVERDUE.getSubCode(), pushSetModel);
        basePushSetList.add(paymentRemindOverduePushSetEntity);

        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * 获取saas 回款提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @throws IllegalAccessException, XbbException, InstantiationException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    @Deprecated
    private void getMessageSetSaasPaymentSheetAddDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.PAYMENT_SHEET_REMIND));
        List<PushSetEntity> basePushSetList = new ArrayList<>();

        PaymentSheetPushSet paymentSheetPushSet = new PaymentSheetPushSet();
        PushSetEntity paymentSheetPushSetEntity = paymentSheetPushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_SHEET_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(paymentSheetPushSetEntity);

        PaymentSheetRedPushSet paymentSheetRedPushSet = new PaymentSheetRedPushSet();
        PushSetEntity paymentSheetRedPushSetEntity = paymentSheetRedPushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_SHEET_RED_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(paymentSheetRedPushSetEntity);

        PaymentSheetBadPushSet paymentSheetBadPushSet = new PaymentSheetBadPushSet();
        PushSetEntity paymentSheetBadPushSetEntity = paymentSheetBadPushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_SHEET_BAD_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(paymentSheetBadPushSetEntity);

        PaymentSheetPrepaymentSet prepaymentPushSet = new PaymentSheetPrepaymentSet();
        PushSetEntity prepaymentPushSetEntity = prepaymentPushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_SHEET_PREPAYMENT_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(prepaymentPushSetEntity);

        PaymentSheetRedPrepaymentSet redPrepaymentPushSet = new PaymentSheetRedPrepaymentSet();
        PushSetEntity redPrepaymentPushSetEntity = redPrepaymentPushSet.getPushSet(corpid, PushTypeEnum.PAYMENT_SHEET_RED_PREPAYMENT_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(redPrepaymentPushSetEntity);

        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 合同提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasContractRemindDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        ContractRemindPushSet contractRemindPushSet = new ContractRemindPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.CONTRACT_REMIND));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            PushSetEntity pushSetEntity = contractRemindPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 合同消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasContractPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.CONTRACT_ADD_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.CONTRACT_CHANGE_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.CONTRACT_TEAM_ADD_DEL_MAIN_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.CONTRACT_TEAM_ADD_DEL_SYNERGETIC_PUSH.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        ContractPushSet contractPushSet = new ContractPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.CONTRACT_BASE));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = contractPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 跟进记录消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasCommunicatePushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.COMMUNICATE_ADD_PUSH.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        CommunicatePushSet communicatePushSet = new CommunicatePushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.COMMUNICATE_BASE));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = communicatePushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 访客计划消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasCommunicatePlanPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.COMMUNICATE_PLAN_ADD_PUSH.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        CommunicatePlanPushSet communicatePlanPushSet = new CommunicatePlanPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.COMMUNICATE_PLAN_BASE));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = communicatePlanPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 销售机会消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasOpportunityPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (pushTypeEnum.getSubCode() > 0) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        OpportunityPushSet opportunityPushSet = new OpportunityPushSet();
        MessageSetDetailPojo baseDetail = new MessageSetDetailPojo();
        baseDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.OPPORTUNITY_BASE));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = opportunityPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        baseDetail.setValue(pushSetVOList);

        messageSetDetailPojos.add(baseDetail);
    }

    /**
     * Description: 获取saas 客户联系人提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasContactPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));

        List<PushTypeEnum> basePusTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.CONTACT_NEW.getSubCode())) {
                basePusTypeEnum.add(pushTypeEnum);
            }
        }
        CustomerContactPushSet customerContactPushSet = new CustomerContactPushSet();
        MessageSetDetailPojo baseDetail = new MessageSetDetailPojo();
        baseDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.CONTACT_BASE));

        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePusTypeEnum) {
            PushSetEntity pushSetEntity = customerContactPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        baseDetail.setValue(pushSetVOList);

        messageSetDetailPojos.add(baseDetail);
    }

    /**
     * Description: 获取saas 客户消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasCustomerPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> baseTypeEnum = new ArrayList<>();
        List<PushTypeEnum> otherTypeEnum = new ArrayList<>();
        boolean isCustomerPublicSeniorModel = commonHelp.isCustomerPublicPoolSeniorModel(corpid);
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            Integer subCode = pushTypeEnum.getSubCode();
            boolean transferPush = isCustomerPublicSeniorModel && Objects.equals(subCode, PushTypeEnum.CUSTOMER_TRANSFER_PUBLIC.getSubCode());
            if (Objects.equals(subCode, PushTypeEnum.CUSTOMER_ADD_PUSH.getSubCode())
                    || Objects.equals(subCode, PushTypeEnum.CUSTOMER_CHANGE_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CUSTOMER_BACK_PUBLIC.getSubCode()) ||  transferPush) {
                baseTypeEnum.add(pushTypeEnum);
            }
            if (Objects.equals(subCode, PushTypeEnum.CUSTOMER_HANDOVER_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CUSTOMER_DISTRIBUTION_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CUSTOMER_TEAM_ADD_DEL_MAIN.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CUSTOMER_TEAM_ADD_DEL_SYNERGETIC.getSubCode())) {
                otherTypeEnum.add(pushTypeEnum);
            }
        }

        CustomerPushSet customerPushSet = new CustomerPushSet();
        MessageSetDetailPojo baseDetail = new MessageSetDetailPojo();
        baseDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.CUSTOMER_BASE));

        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : baseTypeEnum) {
            PushSetEntity pushSetEntity = customerPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> basePushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, basePushSetVOList, PushSetVO.class);
        baseDetail.setValue(basePushSetVOList);

        messageSetDetailPojos.add(baseDetail);

        MessageSetDetailPojo otherDetail = new MessageSetDetailPojo();
        otherDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.CUSTOMER_FOLLOW));
        List<PushSetEntity> otherPushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : otherTypeEnum) {
            PushSetEntity pushSetEntity = customerPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            otherPushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> otherPushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(otherPushTypeList, otherPushSetVOList, PushSetVO.class);
        otherDetail.setValue(otherPushSetVOList);

        messageSetDetailPojos.add(otherDetail);
    }

    /**
     * Description: 获取saas 客户消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasCluePushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> baseTypeEnum = new ArrayList<>();
        List<PushTypeEnum> otherTypeEnum = new ArrayList<>();
        boolean isCluePublicSeniorModel = commonHelp.isCluePublicPoolSeniorModel(corpid);
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            Integer subCode = pushTypeEnum.getSubCode();
            boolean transferPush = isCluePublicSeniorModel && Objects.equals(subCode, PushTypeEnum.CLUE_TRANSFER_PUBLIC.getSubCode());
            if (Objects.equals(subCode, PushTypeEnum.CLUE_ADD_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CLUE_CHANGE_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CLUE_BACK_PUBLIC.getSubCode()) || transferPush) {
                baseTypeEnum.add(pushTypeEnum);
            }
            if (Objects.equals(subCode, PushTypeEnum.CLUE_HANDOVER_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CLUE_DISTRIBUTION_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CLUE_TEAM_ADD_DEL_MAIN.getSubCode()) || Objects.equals(subCode, PushTypeEnum.CLUE_TEAM_ADD_DEL_SYNERGETIC.getSubCode())) {
                otherTypeEnum.add(pushTypeEnum);
            }
        }

        CluePushSet cluePushSet = new CluePushSet();
        MessageSetDetailPojo baseDetail = new MessageSetDetailPojo();
        baseDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.CLUE_BASE));

        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : baseTypeEnum) {
            PushSetEntity pushSetEntity = cluePushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> basePushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, basePushSetVOList, PushSetVO.class);
        baseDetail.setValue(basePushSetVOList);

        messageSetDetailPojos.add(baseDetail);

        MessageSetDetailPojo otherDetail = new MessageSetDetailPojo();
        otherDetail.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.CLUE_FOLLOW));
        List<PushSetEntity> otherPushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : otherTypeEnum) {
            PushSetEntity pushSetEntity = cluePushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            otherPushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> otherPushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(otherPushTypeList, otherPushSetVOList, PushSetVO.class);
        otherDetail.setValue(otherPushSetVOList);

        messageSetDetailPojos.add(otherDetail);
    }

    /**
     * Description: 获取saas 报价单提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasQuotationRemindDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        QuotationRemindPushSet quotationRemindPushSet = new QuotationRemindPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.QUOTATION_REMIND));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            PushSetEntity pushSetEntity = quotationRemindPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }


    /**
     * Description: 获取saas 报价单消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     */
    @Deprecated
    private void getMessageSetSaasQuotationPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : pushTypeEnumList) {
            if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.QUOTATION_ADD_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.QUOTATION_STATUS_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.QUOTATION_TEAM_ADD_DEL_MAIN_PUSH.getSubCode()) || Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.QUOTATION_TEAM_ADD_DEL_SYNERGETIC_PUSH.getSubCode())) {
                basePushTypeEnum.add(pushTypeEnum);
            }
        }

        QuotationPushSet quotationPushSet = new QuotationPushSet();
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.QUOTATION_RASE));
        List<PushSetEntity> basePushTypeList = new ArrayList<>();
        for (PushTypeEnum pushTypeEnum : basePushTypeEnum) {
            PushSetEntity pushSetEntity = quotationPushSet.getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel);
            basePushTypeList.add(pushSetEntity);
        }
        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushTypeList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 付款提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     */
    @Deprecated
    private void getMessageSetSaasPayPlanAddDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.PAY_PLAN_REMIND));
        List<PushSetEntity> basePushSetList = new ArrayList<>();

        PayPlanPushSet payPlanPushSet = new PayPlanPushSet();
        PushSetEntity payPlanPushSetEntity = payPlanPushSet.getPushSet(corpid, PushTypeEnum.PAY_PLAN_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(payPlanPushSetEntity);

        PayPlanRemindPushSet payPlanRemindPushSet = new PayPlanRemindPushSet();
        PushSetEntity payPlanRemindPushSetEntity = payPlanRemindPushSet.getPushSet(corpid, PushTypeEnum.PAY_PLAN_REMIND.getSubCode(), pushSetModel);
        basePushSetList.add(payPlanRemindPushSetEntity);

        PayPlanRemindOverduePushSet payPlanRemindOverduePushSet = new PayPlanRemindOverduePushSet();
        PushSetEntity payPlanRemindOverduePushSetEntity = payPlanRemindOverduePushSet.getPushSet(corpid, PushTypeEnum.PAY_PLAN_OVERDUE.getSubCode(), pushSetModel);
        basePushSetList.add(payPlanRemindOverduePushSetEntity);

        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }


    /**
     * 获取saas 付款单提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @throws IllegalAccessException, XbbException, InstantiationException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    @Deprecated
    private void getMessageSetSaasPaySheetAddDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo();
        detailPojo.setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.PAY_SHEET_REMIND));
        List<PushSetEntity> basePushSetList = new ArrayList<>();

        PaySheetPushSet paySheetPushSet = new PaySheetPushSet();
        PushSetEntity paySheetPushSetEntity = paySheetPushSet.getPushSet(corpid, PushTypeEnum.PAY_SHEET_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(paySheetPushSetEntity);

        PaySheetRedPushSet paySheetRedPushSet = new PaySheetRedPushSet();
        PushSetEntity paySheetRedPushSetEntity = paySheetRedPushSet.getPushSet(corpid, PushTypeEnum.PAY_SHEET_RED_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(paySheetRedPushSetEntity);

        PaySheetBadPushSet paySheetBadPushSet = new PaySheetBadPushSet();
        PushSetEntity paySheetBadPushSetEntity = paySheetBadPushSet.getPushSet(corpid, PushTypeEnum.PAY_SHEET_BAD_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(paySheetBadPushSetEntity);

        PaySheetPrepaySet prepayPushSet = new PaySheetPrepaySet();
        PushSetEntity prepayPushSetEntity = prepayPushSet.getPushSet(corpid, PushTypeEnum.PAY_SHEET_PREPAY_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(prepayPushSetEntity);

        PaySheetRedPrepaySet redPrepayPushSet = new PaySheetRedPrepaySet();
        PushSetEntity redPrepayPushSetEntity = redPrepayPushSet.getPushSet(corpid, PushTypeEnum.PAY_SHEET_RED_PREPAY_ADD.getSubCode(), pushSetModel);
        basePushSetList.add(redPrepayPushSetEntity);

        List<PushSetVO> pushSetVOList = new ArrayList<>();
        BeanUtil.copyPropertiesList(basePushSetList, pushSetVOList, PushSetVO.class);
        detailPojo.setValue(pushSetVOList);
        messageSetDetailPojos.add(detailPojo);
    }
    /**
     * Description: 获取saas 经销商联系人提醒消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasDistributorContactPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {

        List<PushTypeEnum> basePushTypeEnum = new ArrayList<PushTypeEnum>(){{
            new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt)).forEach(pushTypeEnum->{
                if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.DISTRIBUTOR_CONTACT_ADD_PUSH.getSubCode())) {
                    add(pushTypeEnum);
                }
            });
        }};

        List<PushSetEntity> basePushTypeList = new ArrayList<PushSetEntity>(){{
            basePushTypeEnum.forEach(pushTypeEnum->{
                add(new DistributorContactPushSet().getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel));
            });
        }};


        MessageSetDetailPojo baseDetail = new MessageSetDetailPojo(){{
            setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.DISTRIBUTOR_CONTACT_BASE));
            setValue(new ArrayList<PushSetVO>(){{
                BeanUtil.copyPropertiesList(basePushTypeList, this, PushSetVO.class);
            }});
        }};

        messageSetDetailPojos.add(baseDetail);
    }

    /**
     * Description: 获取saas 经销商跟进记录消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasDistributorCommunicatePushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> basePushTypeEnum = new ArrayList<PushTypeEnum>(){{
            new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt)).forEach(pushTypeEnum->{
                if (Objects.equals(pushTypeEnum.getSubCode(), PushTypeEnum.DISTRIBUTOR_COMMUNICATE_ADD_PUSH.getSubCode())) {
                    add(pushTypeEnum);
                }
            });
        }};

        List<PushSetEntity> basePushTypeList = new ArrayList<PushSetEntity>(){{
            basePushTypeEnum.forEach(pushTypeEnum->{
                add(new DistributorCommunicatePushSet().getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel));
            });
        }};

        MessageSetDetailPojo detailPojo = new MessageSetDetailPojo(){{
            setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.DISTRIBUTOR_COMMUNICATE_BASE));
            setValue(new ArrayList<PushSetVO>(){{
                BeanUtil.copyPropertiesList(basePushTypeList, this, PushSetVO.class);
            }});
        }};

        messageSetDetailPojos.add(detailPojo);
    }

    /**
     * Description: 获取saas 经销商消息设置详情list
     * @param corpid 公司id
     * @param messageSetDetailPojos 消息设置详情pojo list
     * @param typeInt 消息类型
     */
    @Deprecated
    private void getMessageSetSaasDistributorPushDetailList(String corpid, List<MessageSetDetailPojo> messageSetDetailPojos, Integer typeInt) throws IllegalAccessException, XbbException, InstantiationException {
        List<PushTypeEnum> pushTypeEnumList = new ArrayList<>(PushTypeEnum.getAllEnumByType(typeInt));
        List<PushTypeEnum> baseTypeEnum = new ArrayList<>();
        List<PushTypeEnum> otherTypeEnum = new ArrayList<>();
        pushTypeEnumList.forEach(pushTypeEnum->{
            Integer subCode = pushTypeEnum.getSubCode();
            if (Objects.equals(subCode, PushTypeEnum.DISTRIBUTOR_ADD_PUSH.getSubCode())) {
                baseTypeEnum.add(pushTypeEnum);
            }
            if (Objects.equals(subCode, PushTypeEnum.DISTRIBUTOR_HANDOVER_PUSH.getSubCode()) || Objects.equals(subCode, PushTypeEnum.DISTRIBUTOR_TEAM_ADD_DEL_MAIN.getSubCode()) || Objects.equals(subCode, PushTypeEnum.DISTRIBUTOR_TEAM_ADD_DEL_SYNERGETIC.getSubCode())) {
                otherTypeEnum.add(pushTypeEnum);
            }
        });

        List<PushSetEntity> basePushTypeList = new ArrayList<PushSetEntity>(){{
            baseTypeEnum.forEach(pushTypeEnum->{
                add(new DistributorPushSet().getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel));
            });
        }};

        MessageSetDetailPojo baseDetail = new MessageSetDetailPojo(){{
            setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.DISTRIBUTOR_BASE));
            setValue(new ArrayList<PushSetVO>(){{
                BeanUtil.copyPropertiesList(basePushTypeList, this, PushSetVO.class);
            }});
        }};
        messageSetDetailPojos.add(baseDetail);

        List<PushSetEntity> otherPushTypeList = new ArrayList<PushSetEntity>(){{
            otherTypeEnum.forEach(pushTypeEnum -> {
                add(new DistributorPushSet().getPushSet(corpid, pushTypeEnum.getSubCode(), pushSetModel));
            });
        }};
        MessageSetDetailPojo otherDetail = new MessageSetDetailPojo(){{
            setTitle(I18nMessageUtil.getMessage(MessageSetDetailTitleConstants.DISTRIBUTOR_FOLLOW));
            setValue(new ArrayList<PushSetVO>(){{
                BeanUtil.copyPropertiesList(otherPushTypeList, this, PushSetVO.class);
            }});
        }};
        messageSetDetailPojos.add(otherDetail);
    }

    @Deprecated
    private void initWorkOrderV2DetailList(){
        //创建人
        JSONObject creator = new JSONObject();
        creator.put("name", PushObjectTypeEnum.CREATOR.getName());
        creator.put("enable", 1);
        creator.put("alias", PushObjectTypeEnum.CREATOR.getAlias());
        //负责人
        JSONObject owner = new JSONObject();
        owner.put("name", PushObjectTypeEnum.MAINUSER.getName());
        owner.put("enable", 1);
        owner.put("alias", PushObjectTypeEnum.MAINUSER.getAlias());
        //协同人
        JSONObject collaborator = new JSONObject();
        collaborator.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        collaborator.put("enable", 1);
        collaborator.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());

        //工单新建
        PushSetEntity pushSetEntity1 = new PushSetEntity();
        pushSetEntity1.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_ADD.getSubCode());
        pushSetEntity1.setPushObject(initPushObjectAdd());
        initBaseParam(pushSetEntity1);
        //工单分配
        PushSetEntity pushSetEntity2 = new PushSetEntity();
        pushSetEntity2.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_ALLOCATE.getSubCode());
        pushSetEntity2.setPushObject(initPushObject());
        initBaseParam(pushSetEntity2);
        //工单移交
        PushSetEntity pushSetEntity3 = new PushSetEntity();
        pushSetEntity3.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_TRANSFER.getSubCode());
        pushSetEntity3.setPushObject(initPushObject());
        initBaseParam(pushSetEntity3);
        //工单团队
        PushSetEntity pushSetEntity4 = new PushSetEntity();
        pushSetEntity4.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_TEAM.getSubCode());
        pushSetEntity4.setPushObject(initPushObjectTeam());
        initBaseParam(pushSetEntity4);
        //工单删除
        PushSetEntity pushSetEntity5 = new PushSetEntity();
        pushSetEntity5.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_DELETE.getSubCode());
        pushSetEntity5.setPushObject(initPushObjectDelete());
        initBaseParam(pushSetEntity5);
        //工单异常
        PushSetEntity pushSetEntity6 = new PushSetEntity();
        pushSetEntity6.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_ABNORMAL.getSubCode());
        pushSetEntity6.setPushObject(initPushObject());
        initBaseParam(pushSetEntity6);
        //工单接受
        PushSetEntity pushSetEntity7 = new PushSetEntity();
        pushSetEntity7.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_RECEIVE.getSubCode());
        pushSetEntity7.setPushObject(initPushObject());
        initBaseParam(pushSetEntity7);
        //工单开始
        PushSetEntity pushSetEntity8 = new PushSetEntity();
        pushSetEntity8.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_START.getSubCode());
        pushSetEntity8.setPushObject(initPushObject());
        initBaseParam(pushSetEntity8);
        //工单完成
        PushSetEntity pushSetEntity9 = new PushSetEntity();
        pushSetEntity9.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_FINISH.getSubCode());
        pushSetEntity9.setPushObject(initPushObject());
        initBaseParam(pushSetEntity9);
        //工单取消
        PushSetEntity pushSetEntity10 = new PushSetEntity();
        pushSetEntity10.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_CANCEL.getSubCode());
        pushSetEntity10.setPushObject(initPushObject());
        initBaseParam(pushSetEntity10);
        //工单结算
        PushSetEntity pushSetEntity11 = new PushSetEntity();
        pushSetEntity11.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_SETTLE.getSubCode());
        pushSetEntity11.setPushObject(initPushObject());
        initBaseParam(pushSetEntity11);
        //工单回访
        PushSetEntity pushSetEntity12 = new PushSetEntity();
        pushSetEntity12.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_VISIT.getSubCode());
        pushSetEntity12.setPushObject(initPushObject());
        initBaseParam(pushSetEntity12);
        //工单抢单
        PushSetEntity pushSetEntity13 = new PushSetEntity();
        pushSetEntity13.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_GRAB.getSubCode());
        pushSetEntity13.setPushObject(initPushObject());
        initBaseParam(pushSetEntity13);
        //工单重启
        PushSetEntity pushSetEntity14 = new PushSetEntity();
        pushSetEntity14.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_RESTART.getSubCode());
        pushSetEntity14.setPushObject(initPushObject());
        initBaseParam(pushSetEntity14);
        //工单回退
        PushSetEntity pushSetEntity15 = new PushSetEntity();
        pushSetEntity15.setSubType(WorkOrderV2PushTypeEnum.WORK_ORDER_V2_BACK.getSubCode());
        pushSetEntity15.setPushObject(initPushObject());
        initBaseParam(pushSetEntity15);

        //插入数据库
        try {
            pushSetModel.insert(pushSetEntity1);
            pushSetModel.insert(pushSetEntity2);
            pushSetModel.insert(pushSetEntity3);
            pushSetModel.insert(pushSetEntity4);
            pushSetModel.insert(pushSetEntity5);
            pushSetModel.insert(pushSetEntity6);
            pushSetModel.insert(pushSetEntity7);
            pushSetModel.insert(pushSetEntity8);
            pushSetModel.insert(pushSetEntity9);
            pushSetModel.insert(pushSetEntity10);
            pushSetModel.insert(pushSetEntity11);
            pushSetModel.insert(pushSetEntity12);
            pushSetModel.insert(pushSetEntity13);
            pushSetModel.insert(pushSetEntity14);
            pushSetModel.insert(pushSetEntity15);
        }catch (XbbException e){
            e.printStackTrace();
        }

    }

    private String initPushObject(){
        JSONObject pushObject = new JSONObject();
        //创建人,负责人,协同人
        JSONArray typeArray = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject.put("enable", 0);
        jsonObject.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject);
        JSONObject jsonObject1 = new JSONObject();
        jsonObject1.put("name", PushObjectTypeEnum.MAINUSER.getName());
        jsonObject1.put("enable", 1);
        jsonObject1.put("alias", PushObjectTypeEnum.MAINUSER.getAlias());
        typeArray.add(jsonObject1);
        JSONObject jsonObject2 = new JSONObject();
        jsonObject2.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject2.put("enable", 1);
        jsonObject2.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject2);
        pushObject.put("type", typeArray);
        //上级主管
        JSONObject managerObject = new JSONObject();
        managerObject.put("enable", 0);
        managerObject.put("value", new ArrayList<>());
        pushObject.put("manager", managerObject);
        //自定义人员
        JSONObject userObject = new JSONObject();
        userObject.put("enable", 0);
        userObject.put("value", new ArrayList<>());
        pushObject.put("user", userObject);
        return pushObject.toJSONString();
    }

    private String initPushObjectAdd(){
        JSONObject pushObject = new JSONObject();
        //创建人,负责人,协同人
        JSONArray typeArray = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject.put("enable", 0);
        jsonObject.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject);
        JSONObject jsonObject1 = new JSONObject();
        jsonObject1.put("name", PushObjectTypeEnum.MAINUSER.getName());
        jsonObject1.put("enable", 0);
        jsonObject1.put("alias", PushObjectTypeEnum.MAINUSER.getAlias());
        typeArray.add(jsonObject1);
        JSONObject jsonObject2 = new JSONObject();
        jsonObject2.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject2.put("enable", 1);
        jsonObject2.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject2);
        pushObject.put("type", typeArray);
        //上级主管
        JSONObject managerObject = new JSONObject();
        managerObject.put("enable", 0);
        managerObject.put("value", new ArrayList<>());
        pushObject.put("manager", managerObject);
        //自定义人员
        JSONObject userObject = new JSONObject();
        userObject.put("enable", 0);
        userObject.put("value", new ArrayList<>());
        pushObject.put("user", userObject);
        return pushObject.toJSONString();
    }

    private String initPushObjectTeam(){
        JSONObject pushObject = new JSONObject();
        //创建人,负责人,协同人
        JSONArray typeArray = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject.put("enable", 0);
        jsonObject.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject);
        JSONObject jsonObject1 = new JSONObject();
        jsonObject1.put("name", PushObjectTypeEnum.MAINUSER.getName());
        jsonObject1.put("enable", 0);
        jsonObject1.put("alias", PushObjectTypeEnum.MAINUSER.getAlias());
        typeArray.add(jsonObject1);
        JSONObject jsonObject2 = new JSONObject();
        jsonObject2.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject2.put("enable", 1);
        jsonObject2.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject2);
        pushObject.put("type", typeArray);
        //上级主管
        JSONObject managerObject = new JSONObject();
        managerObject.put("enable", 0);
        managerObject.put("value", new ArrayList<>());
        pushObject.put("manager", managerObject);
        //自定义人员
        JSONObject userObject = new JSONObject();
        userObject.put("enable", 0);
        userObject.put("value", new ArrayList<>());
        pushObject.put("user", userObject);
        return pushObject.toJSONString();
    }

    private String initPushObjectDelete(){
        JSONObject pushObject = new JSONObject();
        //创建人,负责人,协同人
        JSONArray typeArray = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject.put("enable", 1);
        jsonObject.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject);
        JSONObject jsonObject1 = new JSONObject();
        jsonObject1.put("name", PushObjectTypeEnum.MAINUSER.getName());
        jsonObject1.put("enable", 1);
        jsonObject1.put("alias", PushObjectTypeEnum.MAINUSER.getAlias());
        typeArray.add(jsonObject1);
        JSONObject jsonObject2 = new JSONObject();
        jsonObject2.put("name", PushObjectTypeEnum.COLLABORATOR.getName());
        jsonObject2.put("enable", 0);
        jsonObject2.put("alias", PushObjectTypeEnum.COLLABORATOR.getAlias());
        typeArray.add(jsonObject2);
        pushObject.put("type", typeArray);
        //上级主管
        JSONObject managerObject = new JSONObject();
        managerObject.put("enable", 0);
        managerObject.put("value", new ArrayList<>());
        pushObject.put("manager", managerObject);
        //自定义人员
        JSONObject userObject = new JSONObject();
        userObject.put("enable", 0);
        userObject.put("value", new ArrayList<>());
        pushObject.put("user", userObject);
        return pushObject.toJSONString();
    }

    private void initBaseParam(PushSetEntity pushSetEntity){
        pushSetEntity.setCorpid("0");
        pushSetEntity.setRefEntity(0);
        pushSetEntity.setAttrEntity("");
        pushSetEntity.setType(XbbRefTypeEnum.WORK_ORDER_V2.getCode());
        pushSetEntity.setPushTime("{}");
        pushSetEntity.setEnable(0);
        pushSetEntity.setDel(0);
        pushSetEntity.setTemplateId((long) 0);
    }
}
